﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterCRM.master" AutoEventWireup="true" CodeFile="Admin.aspx.cs" Inherits="Admin_Admin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/stylesheet.css" /><!--Calendar's specific js-->    
    
    <script type="text/javascript" src="../js/Calendar.js"></script><!--Calendar's specific js-->    
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/jquery.easing.min.js"></script>
    <script type="text/javascript" src="../js/jquery.lavalamp.min.js"></script>
    <script type="text/javascript">
      $(function () {
        $("#lava_menu").lavaLamp({
          fx: "backout",
          speed: 700
        });
      });
    </script>
    <script type="text/javascript" src="../js/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
      $(window).load(function () {
        $('#slider').nivoSlider();

      });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
  <div id="stylized" class="myform">
    <asp:DropDownList ID="ddlAction" runat="server" AutoPostBack="true" onselectedindexchanged="ddlAction_SelectedIndexChanged">
    <asp:ListItem Text="--Select Action--"></asp:ListItem>
     <asp:ListItem Text="Add AC Brand"></asp:ListItem>
     <asp:ListItem Text="Add Installer"></asp:ListItem>
     <asp:ListItem Text="Add Dealer"></asp:ListItem>     
    </asp:DropDownList>
    <asp:Label ID="lblActionReq" runat="server"  CssClass="error" >*</asp:Label>
          <asp:RequiredFieldValidator ID="reqAction" runat="server" ControlToValidate="ddlAction" InitialValue="0" SetFocusOnError="true" 
            CssClass="error" Text="Req" ErrorMessage="Req" ValidationGroup="submit" ></asp:RequiredFieldValidator>    
    
    <asp:MultiView id="mvActions" runat="server" >
      <asp:View ID="vwDefaultView" runat="server">
        <div id="dvDefault" style=" height:380px;" >
          &nbsp;
        </div>
      </asp:View>
      <asp:View ID="vwAddACBrand" runat="server">      
        <div id="mGrid">          
          <asp:ListView ID="lvAcBrands" DataKeyNames="ID" runat="server" DataSourceID="odsAcBrand" 
            InsertItemPosition="LastItem" >
            <InsertItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                  <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                </td>
                <td>
                  <asp:TextBox ID="ACBrandNameTextBox" runat="server" 
                    Text='<%# Bind("ACBrandName") %>' />
                </td>
                <td>
                  <asp:TextBox ID="DescriptionTextBox" runat="server" 
                    Text='<%# Bind("Description") %>' />
                </td>                            
                <td>                  
                  <asp:Label ID="lblLastModifiedUserNameValue" Text='<% MasterCRM.SessionUser.UserName %>' runat="server"/>
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" Text="<% DateTime.Now.ToString() %>" runat="server"/>
                </td>
              </tr>
            </InsertItemTemplate>
            <AlternatingItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
                  <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                  <asp:Label ID="ACBrandNameLabel" runat="server" 
                    Text='<%# Eval("ACBrandName") %>' />
                </td>
                <td>
                  <asp:Label ID="DescriptionLabel" runat="server" 
                    Text='<%# Eval("Description") %>' />
                </td>                                              
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </AlternatingItemTemplate>
            <EditItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                  <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                </td>
                <td>
                  <asp:TextBox ID="ACBrandNameTextBox" runat="server" 
                    Text='<%# Bind("ACBrandName") %>' />
                </td>
                <td>
                  <asp:TextBox ID="DescriptionTextBox" runat="server" 
                    Text='<%# Bind("Description") %>' />
                </td>                                
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </EditItemTemplate>
            <EmptyDataTemplate>
              <table runat="server" style="">
                <tr>
                  <td>
                    No data was returned.</td>
                </tr>
              </table>
            </EmptyDataTemplate>
            
            <ItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
                  <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                  <asp:Label ID="ACBrandNameLabel" runat="server" 
                    Text='<%# Eval("ACBrandName") %>' />
                </td>
                <td>
                  <asp:Label ID="DescriptionLabel" runat="server" 
                    Text='<%# Eval("Description") %>' />
                </td>                            
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </ItemTemplate>
            <LayoutTemplate>
              <table runat="server">
                <tr runat="server">
                  <td runat="server">
                    <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                      <tr runat="server" style="">
                        <th runat="server">
                          </th>
                        <th runat="server">
                          ACBrandName</th>
                        <th runat="server">
                          Description</th>                                                
                        <th runat="server">
                          LastModifiedUser</th>
                        <th runat="server">
                          LastModifiedDateTime</th>
                      </tr>
                      <tr ID="itemPlaceholder" runat="server">
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr runat="server">
                  <td runat="server" style="">
                  </td>
                </tr>
              </table>
            </LayoutTemplate>
            
          </asp:ListView>
          <asp:ObjectDataSource ID="odsAcBrand" runat="server" 
            TypeName="GrewalCRM.BLL.ACBrands_BLL" SelectMethod="GetAllACBrands" 
            DataObjectTypeName="GrewalCRM.Entities.ACBrands" 
            DeleteMethod="Save" InsertMethod="Save" UpdateMethod="Save" 
            oninserting="odsAcBrand_Inserting" ondeleting="odsAcBrand_Deleting" 
            onupdating="odsAcBrand_Updating">
          </asp:ObjectDataSource>                
        </div>       
      </asp:View>
      <asp:View ID="vwInstaller" runat="server">      
        <div id="divInstaller" class="gridView">          
          <asp:ListView ID="lvInstaller" DataKeyNames="ID" runat="server" DataSourceID="odsInstaller" 
            InsertItemPosition="LastItem" >
            <LayoutTemplate>
              <table id="Table2" runat="server">
                <tr id="Tr1" runat="server">
                  <td id="Td1" runat="server">
                    <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                      <tr id="Tr2" runat="server" style="">
                        <th id="Th1" runat="server">
                          </th>
                        <th id="Th2" runat="server">
                          Installer Name</th>
                        <th id="Th3" runat="server">
                          Address</th>
                        <th id="Th4" runat="server">
                          phoneNo</th>
                        <th id="Th5" runat="server">
                          mobileNo</th>
                        <th id="Th6" runat="server">
                          installerCommission</th>                                                
                        <th id="Th7" runat="server">
                          LastModifiedUser</th>
                        <th id="Th8" runat="server">
                          LastModifiedDateTime</th>
                      </tr>
                      <tr ID="itemPlaceholder" runat="server">
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr id="Tr3" runat="server">
                  <td id="Td2" runat="server" style="">
                  </td>
                </tr>
              </table>
            </LayoutTemplate>
            <InsertItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                  <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                </td>
                <td>
                  <asp:TextBox ID="InstallerTextBox" runat="server" 
                    Text='<%# Bind("InstallerName") %>' />
                </td>
                <td>
                  <asp:TextBox ID="AddressTextBox" runat="server" 
                    Text='<%# Bind("Address") %>' />
                </td>
                <td>
                  <asp:TextBox ID="phoneNoTextBox" runat="server" 
                    Text='<%# Bind("phoneNo") %>' />
                </td>
                <td>
                  <asp:TextBox ID="mobileNoTextBox" runat="server" 
                    Text='<%# Bind("mobileNo") %>' />
                </td> 
                <td>
                  <asp:TextBox ID="installerCommissionTextBox" runat="server" 
                    Text='<%# Bind("installerCommission") %>' />
                </td>      
                <td>                  
                  <asp:Label ID="lblLastModifiedUserNameValue" Text='<% MasterCRM.SessionUser.UserName %>' runat="server"/>
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" Text="<% DateTime.Now.ToString() %>" runat="server"/>
                </td>
              </tr>
            </InsertItemTemplate>
            <ItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
                  <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                  <asp:Label ID="InstallerLabel" runat="server" 
                    Text='<%# Eval("InstallerName") %>' />
                </td>
                <td>
                  <asp:Label ID="AddressLabel" runat="server" 
                    Text='<%# Eval("Address") %>' />
                </td>
                <td>
                  <asp:Label ID="phoneNoLabel" runat="server" 
                    Text='<%# Eval("phoneNo") %>' />
                </td>
                <td>
                  <asp:Label ID="mobileNoLabel" runat="server" 
                    Text='<%# Eval("mobileNo") %>' />
                </td> 
                <td>
                  <asp:Label ID="installerCommissionLabel" runat="server" 
                    Text='<%# Eval("installerCommission") %>' />
                </td>                            
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
                  <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                  <asp:Label ID="InstallerLabel" runat="server" 
                    Text='<%# Eval("InstallerName") %>' />
                </td>
                <td>
                  <asp:Label ID="AddressLabel" runat="server" 
                    Text='<%# Eval("Address") %>' />
                </td>
                <td>
                  <asp:Label ID="phoneNoLabel" runat="server" 
                    Text='<%# Eval("phoneNo") %>' />
                </td>
                <td>
                  <asp:Label ID="mobileNoLabel" runat="server" 
                    Text='<%# Eval("mobileNo") %>' />
                </td> 
                <td>
                  <asp:Label ID="installerCommissionLabel" runat="server" 
                    Text='<%# Eval("installerCommission") %>' />
                </td>                                                 
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </AlternatingItemTemplate>           
            <EditItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                  <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                </td>
                <td>
                  <asp:TextBox ID="InstallerTextBox" runat="server" 
                    Text='<%# Bind("InstallerName") %>' />
                </td>
                <td>
                  <asp:TextBox ID="AddressTextBox" runat="server" 
                    Text='<%# Bind("Address") %>' />
                </td>
                <td>
                  <asp:TextBox ID="phoneNoTextBox" runat="server" 
                    Text='<%# Bind("phoneNo") %>' />
                </td>
                <td>
                  <asp:TextBox ID="mobileNoTextBox" runat="server" 
                    Text='<%# Bind("mobileNo") %>' />
                </td> 
                <td>
                  <asp:TextBox ID="installerCommissionTextBox" runat="server" 
                    Text='<%# Bind("installerCommission") %>' />
                </td>                              
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </EditItemTemplate>
            <EmptyDataTemplate>
              <table id="Table1" runat="server" style="">
                <tr>
                  <td>
                    No data was returned.</td>
                </tr>
              </table>
            </EmptyDataTemplate>
          </asp:ListView>
          <asp:ObjectDataSource ID="odsInstaller" runat="server" 
            TypeName="GrewalCRM.BLL.InstallersMaster_BLL" SelectMethod="GetAllInstaller" 
            DataObjectTypeName="GrewalCRM.Entities.InstallersMaster" 
            DeleteMethod="Save" InsertMethod="Save" UpdateMethod="Save" 
            oninserting="odsInstaller_Inserting" ondeleting="odsInstaller_Deleting" 
            onupdating="odsInstaller_Updating">
          </asp:ObjectDataSource>                
        </div>       
      </asp:View>
       <asp:View ID="vwDealer" runat="server">      
        <div id="dvDealer" class="gridView">          
          <asp:ListView ID="lvDealer" DataKeyNames="ID" runat="server" DataSourceID="odcDealer" 
            InsertItemPosition="LastItem" >
            <LayoutTemplate>
              <table id="Table2" runat="server">
                <tr id="Tr1" runat="server">
                  <td id="Td1" runat="server">
                    <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                      <tr id="Tr2" runat="server" style="">
                        <th id="Th1" runat="server">
                          </th>
                        <th id="Th2" runat="server">
                          Dealer Name</th>
                        <th id="Th3" runat="server">
                          Counter</th>
                        <th id="Th4" runat="server">
                          Address</th>
                        <th id="Th5" runat="server">
                          Contact No</th>
                        <th id="Th6" runat="server">
                          Dealer Commission</th>                                                
                        <th id="Th7" runat="server">
                          Last Modified User</th>
                        <th id="Th8" runat="server">
                          Last Modified DateTime</th>
                      </tr>                     
                      <tr ID="itemPlaceholder" runat="server">
                      </tr>
                    </table>
                  </td>
                </tr>                
                <tr id="Tr3" runat="server">
                  <td id="Td2" runat="server" style="">
                  </td>
                </tr>                               
              </table>
            </LayoutTemplate>
            <InsertItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                  <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
                </td>
                <td>
                  <asp:TextBox ID="InstallerTextBox" runat="server" 
                    Text='<%# Bind("DealerName") %>' />
                </td>
                <td>
                  <asp:TextBox ID="AddressTextBox" runat="server" 
                    Text='<%# Bind("Counter") %>' />
                </td>
                <td>
                  <asp:TextBox ID="phoneNoTextBox" runat="server" 
                    Text='<%# Bind("Address") %>' />
                </td>
                <td>
                  <asp:TextBox ID="mobileNoTextBox" runat="server" 
                    Text='<%# Bind("ContactNo") %>' />
                </td> 
                <td>
                  <asp:TextBox ID="installerCommissionTextBox" runat="server" 
                    Text='<%# Bind("DealerCommission") %>' />
                </td>                  
                <td>                  
                  <asp:Label ID="lblLastModifiedUserNameValue" Text='<% MasterCRM.SessionUser.UserName %>' runat="server"/>
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" Text="<% DateTime.Now.ToString() %>" runat="server"/>
                </td>
              </tr>
            </InsertItemTemplate>
            <ItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
                  <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                  <asp:Label ID="InstallerLabel" runat="server" 
                    Text='<%# Eval("DealerName") %>' />
                </td>
                <td>
                  <asp:Label ID="AddressLabel" runat="server" 
                    Text='<%# Eval("Counter") %>' />
                </td>
                <td>
                  <asp:Label ID="phoneNoLabel" runat="server" 
                    Text='<%# Eval("Address") %>' />
                </td>
                <td>
                  <asp:Label ID="mobileNoLabel" runat="server" 
                    Text='<%# Eval("ContactNo") %>' />
                </td> 
                <td>
                  <asp:Label ID="installerCommissionLabel" runat="server" 
                    Text='<%# Eval("DealerCommission") %>' />
                </td>                                         
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
                  <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
                </td>
                <td>
                  <asp:Label ID="dealerLabel" runat="server" 
                    Text='<%# Eval("DealerName") %>' />
                </td>
                <td>
                  <asp:Label ID="counterLabel" runat="server" 
                    Text='<%# Eval("Counter") %>' />
                </td>
                <td>
                  <asp:Label ID="addressLabel" runat="server" 
                    Text='<%# Eval("Address") %>' />
                </td>
                <td>
                  <asp:Label ID="contactNoLabel" runat="server" 
                    Text='<%# Eval("ContactNo") %>' />
                </td> 
                <td>
                  <asp:Label ID="dealerCommissionLabel" runat="server" 
                    Text='<%# Eval("DealerCommission") %>' />
                </td>                               		                                
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </AlternatingItemTemplate>           
            <EditItemTemplate>
              <tr style="">
                <td>
                  <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                  <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
                </td>
                <td>
                  <asp:TextBox ID="InstallerTextBox" runat="server" 
                    Text='<%# Bind("DealerName") %>' />
                </td>
                <td>
                  <asp:TextBox ID="AddressTextBox" runat="server" 
                    Text='<%# Bind("Counter") %>' />
                </td>
                <td>
                  <asp:TextBox ID="phoneNoTextBox" runat="server" 
                    Text='<%# Bind("Address") %>' />
                </td>
                <td>
                  <asp:TextBox ID="mobileNoTextBox" runat="server" 
                    Text='<%# Bind("ContactNo") %>' />
                </td> 
                <td>
                  <asp:TextBox ID="installerCommissionTextBox" runat="server" 
                    Text='<%# Bind("DealerCommission") %>' />
                </td>               		                                                 
                <td>
                  <asp:Label ID="LastModifiedUserLabel" runat="server" 
                    Text='<%# Eval("LastModifiedUser.UserName") %>' />
                </td>
                <td>
                  <asp:Label ID="LastModifiedDateTimeLabel" runat="server" 
                    Text='<%# Eval("LastModifiedDateTime") %>' />
                </td>
              </tr>
            </EditItemTemplate>
            <EmptyDataTemplate>
              <table id="Table1" runat="server" style="">
                <tr>
                  <td>
                    No data was returned.</td>
                </tr>
              </table>
            </EmptyDataTemplate>
          </asp:ListView>
          <asp:ObjectDataSource ID="odcDealer" runat="server" 
            TypeName="GrewalCRM.BLL.DealersMaster_BLL" SelectMethod="GetAllDealer" 
            DataObjectTypeName="GrewalCRM.Entities.DealersMaster" 
            DeleteMethod="Save" InsertMethod="Save" UpdateMethod="Save" 
            oninserting="odsDealer_Inserting" ondeleting="odsDealer_Deleting" 
            onupdating="odsDealer_Updating">
          </asp:ObjectDataSource>                
        </div>       
      </asp:View>                    
    </asp:MultiView>
    
  </div>
</asp:Content>

